package org.example.controller;

import org.example.service.MenuService;
import org.example.util.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/menu")
@CrossOrigin(origins = "*",maxAge = 3600)
public class MenuController {
    @Resource
    MenuService menuService;

    @GetMapping("/list")
    public Result getMenus(@RequestHeader("token") String token) {
        return menuService.getMenus(token);
    }

    @GetMapping("/all")
    public Result getAll(@RequestHeader("token") String token) {
        return menuService.getAll(token);
    }
}
